package Eyjafjalla.card.attack;

import Eyjafjalla.action.EyjafjallaAttackAction;
import Eyjafjalla.action.IncreaseCardAction;
import Eyjafjalla.action.PushAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class Push_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "Push_Eyjafjalla";
    private static final CardStrings cardStrings;

    public Push_Eyjafjalla(){
        super(ID, cardStrings.NAME,1,cardStrings.DESCRIPTION,CardType.ATTACK,CardRarity.UNCOMMON,CardTarget.ENEMY);
        this.baseDamage = 8;
        this.damage = 8;
        this.baseMagicNumber = 50;
        this.magicNumber = 50;
        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new Push_Eyjafjalla();
    }

    @Override
    public void applyPowers() {
        if(isFire()){
            baseMagicNumber = 75;
        }
        else {
            baseMagicNumber = 50;
        }
        super.applyPowers();
        magicNumber = baseMagicNumber;
        isMagicNumberModified = false;
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new EyjafjallaAttackAction());
        addToBot(new PushAction(m,new DamageInfo(p,this.damage,damageTypeForTurn),isFire()?0.75f:0.5f));
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            upgradeDamage(4);
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}

